<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title>Phsar Khmer | <?php echo $title_for_layout?></title>
	<meta name="language" content="English" />
		<meta name="description" content="Phsarkhmer is the best free post advertising in Cambodia. easy post easy sell easy advertising" />
		<meta name="keywords" content="free post in cambodia, free advertising in cambodia, free online marketplace, online market in Cambodia,phsarkhmer, buy and sell in cambodia, house, land in cambodia, phone shop in cambodia, motorcycle in cambodia, services in cambodia, job search in cambodia, job offer in cambodia, marketplace in cambodia, online post free in cambodia, post free in cambodia, Cambodia, house for sell, rent in cambodia, sale in cambodia, in phnom penh,  hakse phone shop,  hakse, ione, sabay, khmerload, sell online," />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />
		<meta name="format-detection" content="telephone=no">
		
				
		
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css('cake.generic');
		echo $this->Html->css('colorbox');
		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
              
	?>   
        <link href="<?php echo $this->webroot; ?>css/bootstrap.min.css" rel="stylesheet">
        <link href="<?php echo $this->webroot; ?>css/style.css" rel="stylesheet">
        <link href="<?php echo $this->webroot; ?>css/divece-style.css" rel="stylesheet">
        <link href="<?php echo $this->webroot; ?>css/carousel.flexisel.css" rel="stylesheet">
        <link href="<?php echo $this->webroot; ?>css/form.css" rel="stylesheet">
        <script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.min.js"></script>
        <script type="text/javascript" src="<?php echo $this->webroot; ?>js/main.js"></script>
        <script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.js"></script>
        <script type="text/javascript" src="<?php echo $this->webroot; ?>js/jsapi.js"></script>
    
	 
        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
                <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->
        <!--[if lt IE 10]>
                <link href="<?php echo $this->webroot; ?>css/ie8-9-style.css" rel="stylesheet">
        <![endif]-->
</head>
<body>
    <div id="fb-root"></div>

    <?php
        $userdata = $this->session->read('Auth.User');
        $username = $this->session->read('Auth.User.username');
        $role = $this->session->read('Auth.User.role');
    ?>
	<div class="wrapper row">
            <?php echo $this->element('top_header_ads');?>
                
                  <div id="social_media">
                        <div class="container">
                            <p class="pull-left">
                                <?php
                                    if($username) {
                                        //echo 'Welcome '.$username.'! &nbsp;&nbsp;';
                                        echo 'Welcome to PHSAR KHMER &nbsp;';
                                    }
                                ?>
                            </p>
                            <p class="pull-left support">support team e: support@phsarkhmer.biz</p>
                            
                            <?php
                            $faceuser = $this->session->read('userid');
                                if($username || $faceuser) {
                                     echo $this->element('header_user_function');
                                }
                           ?>
                            
                            <div class="media-icon pull-right">
                                    <span>Follow us:</span>
                                    <ul>
                                        <li id="facebook"><a href="https://www.facebook.com/phsarkhmer.biz" target="_blank" alt="facebook"></a></li>
                                        <li id="twitter"><a href="https://twitter.com/phsarkhmer" target="_blank" alt="twitter"></a></li>
                                            <li id="google_plus"><a href="https://plus.google.com/u/0/118160765260349125589" target="_blank"  alt="google plus"></a></li>
                                            <li id="link_in"><a href="http://www.linkedin.com/company/phsarkhmer" target="_blank" alt="link in"></a></li>
                                    </ul>
                            </div>
                        </div>
                </div>
            <div id="left_sidebar" class="col-sm-1"><?php echo $this->element('left_sidebar');?>  </div>
                <div class="main-container col-sm-10">
			<div class="container header-container">
				
					<div class="header">
						<div id="top_header">
							<div class="row">
								<div class="col-sm-4">
									<div id="logo">
										<a href="<?php echo $this->webroot; ?>"><img src="<?php echo $this->webroot; ?>img/logo.png" title="logo" alt="logo"></a>
									</div>
								</div>
								<div id="banner_ads" class="col-sm-8 hidden-xs">
									<?php echo $this->element('banner_ads');?>
								</div>
							</div>
						</div>
						
					</div>
                                <div id="stay_on_top">
                                        <?php echo $this->element('nav');?>
					<?php echo $this->element('search');?>
				</div>
			</div>
			<div class="container whole-content">
				
				<div class="content">
					<div class="row threecolumn">
                                            
						<div class="col-sm-3 left-column">
							<div class="list-group">
								<h3 class="list-group-item active header-side">Categories</h3>
<!--                                                                <a href="#" class="list-group-item">Buy & Sell</a>
								<a href="#" class="list-group-item">Morbi leo risus</a>
								<a href="#" class="list-group-item">Porta ac consectetur ac</a>
								<a href="#" class="list-group-item">Vestibulum at eros</a>  -->
								<?php echo $this->element('left_category');?>  
							</div>
							<div class="ads-content">
								<?php echo $this->element('left_ads');?>  
							</div>
						</div>
						<div class="col-sm-6 middle-column">

                                                    <?php echo $this->Session->flash(); ?>

                                                    <?php
                                                    $faceuser = $this->session->read('userid');
                                                        if($username || $faceuser) {
                                                             echo $this->element('user_function');
                                                        }
                                                   ?>

							<?php echo $this->fetch('content'); ?>
						</div>
						<div class="col-sm-3 right-column">
							<div class="list-group">
								<?php echo $this->element('login');?>
							</div>
							<div class="ads-content">
								<?php echo $this->element('right_ads');?>  
							</div>
						</div>
					</div>
				</div>
			</div>
                </div>
            <div id="right_sidebar" class="col-sm-1"><?php echo $this->element('right_sidebar');?>  </div>
			<!-- FOOTER -->
			<footer id="footer">
				<div class="container">								
					<?php echo $this->element('footer_nav');?>
					<div class="copyright">
						<p>&copy; 2014 Phsarkhmer. All Rights Reserved</p>
					</div>
				</div>
				<div id="footer_bottom">
                                    <marquee behavior="scroll" direction="left">
                                        <p>Phsarkhmer is the best free post advertising in Cambodia. easy post easy sell easy advertising.</p>
                                    </marquee>
				</div>
			</footer>
		</div>
	<!-- Bootstrap core JavaScript
	================================================== -->
	<!-- Placed at the end of the document so the pages load faster -->
	<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="<?php echo $this->webroot; ?>js/bootstrap.min.js"></script>
	<script type="text/javascript" src="<?php echo $this->webroot; ?>js/holder.js"></script>	
	<script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.colorbox.js"></script>
        <script type="text/javascript" src="<?php echo $this->webroot; ?>js/jquery.flexisel.js"></script>
        <script>
    jQuery(document).ready(function(){
        jQuery(".selected").prop('disabled', true);
        jQuery('.prevent a').click(function(e){
            e.preventDefault();
        })
        <?php if($this->Session->check('order')){
            
            foreach($favoriteproducts as $fav) {
              
                ?>
                    jQuery("#<?php echo $fav['Product']['id'] ; ?>").addClass('selected');
                    jQuery("#sale-<?php echo $fav['Product']['id'] ; ?>").addClass('selected');
                    jQuery("#popular-<?php echo $fav['Product']['id'] ; ?>").addClass('selected');
                    jQuery(".<?php echo $fav['Product']['id'] ; ?>").attr('class','disable');
                   jQuery(".sale-<?php echo $fav['Product']['id'] ; ?>").attr('class','disable');
                    jQuery(".popular-<?php echo $fav['Product']['id'] ; ?>").attr('class','disable');<?php
                
            }}?>
    });
    jQuery(".favorite").click(
            function(e)
            {   e.preventDefault();
                jQuery(this).addClass('selected');
                var id=jQuery(this).attr('id');
                jQuery('#sale-'+id).addClass('selected');
                jQuery('#popular-'+id).addClass('selected');
                jQuery('.'+id).attr('class', 'disable');
                jQuery('.sale-'+id).attr('class', 'disable');
                jQuery('.popular-'+id).attr('class', 'disable');
                
                var id=jQuery(this).attr('data');
                jQuery.ajax({
                    type:'POST',
                    url: '<?php echo Router::Url(array('controller' => 'posts', 'action' => 'favorite')); ?>/'+id,
                    success: function(response) {  

                    },
                    data:jQuery('form').serialize()
                });
                return false;
            }
    );
jQuery("#send").click(
            function()
            {   
                jQuery.ajax({
                    type:'POST',
                    url: '<?php echo Router::Url(array('controller' => 'posts', 'action' => 'send')) ?>',
                    success: function(response) {  
                             jQuery("#feedback").html(response);
                    },
                    data:jQuery('#sendEmailContactForm').serialize()
                });
                return false;
            }
    );
</script>
<script>
  window.fbAsyncInit = function() {
  FB.init({
    appId      : '624388847632649',
    status     : true, // check login status
    cookie     : true, // enable cookies to allow the server to access the session
    xfbml      : true  // parse XFBML
  });
  FB.Event.subscribe('auth.authResponseChange', function(response) {
    if (response.status === 'connected') {
      testAPI();
    } else if (response.status === 'not_authorized') {
      FB.login();
    } else {
      FB.login();
    }
  });
  };

  (function(d){
   var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
   if (d.getElementById(id)) {return;}
   js = d.createElement('script'); js.id = id; js.async = true;
   js.src = "//connect.facebook.net/en_US/all.js";
   ref.parentNode.insertBefore(js, ref);
  }(document));

</script>
</body>
</html>
